//利用两个栈实现一个队列
class que {
  constructor() {
    this.stackIn = [];
    this.stackOut = [];
  }
  myPush(s) {
    this.stackIn.push(s);
  }
  myPop() {
    while (this.stackIn.length > 0) {
      this.stackOut.push(this.stackIn.pop());
    }
    return this.stackOut.pop();
  }
}
const que1 = new que();
que1.myPush(1);
que1.myPush(2);
que1.myPush(3);
console.log(que1.myPop());
que1.myPush(4);
que1.myPush(5);
console.log(que1.myPop());
